Skip to content

Shut down leaked executors in test_interpreter_pool#153780

Merged
StanFromIreland merged 1 commit into
python:mainfrom
StanFromIreland:inter-shutdown
Jul 17, 2026
Merged

Shut down leaked executors in test_interpreter_pool#153780
StanFromIreland merged 1 commit into
python:mainfrom
StanFromIreland:inter-shutdown

Conversation

@StanFromIreland

Copy link
Copy Markdown
Member

Several tests created an InterpreterPoolExecutor and never shut it down, so their worker threads were only cleaned up whenever the garbage collector happened to destroy the abandoned executor. On the slow buildbot that took longer than the 1-second limit threading_cleanup() allows in tearDown, for example in this run:

test_submit_func_globals (test.test_concurrent_futures.test_interpreter_pool.InterpreterPoolExecutorTest.test_submit_func_globals) ... Warning -- threading_cleanup() failed to clean up threads in 1.0 seconds
Warning --   before: thread count=0, dangling=1
Warning --   after: thread count=1, dangling=2
Warning -- Dangling thread: <Thread(InterpreterPoolExecutor-57_0, stopped 273622737248)>
Warning -- Dangling thread: <_MainThread(MainThread, started 273774698528)>
test_submit_local_instance (test.test_concurrent_futures.test_interpreter_pool.InterpreterPoolExecutorTest.test_submit_local_instance) ... Warning -- threading_cleanup() failed to clean up threads in 1.0 seconds
Warning --   before: thread count=0, dangling=1
Warning --   after: thread count=1, dangling=2
Warning -- Dangling thread: <Thread(InterpreterPoolExecutor-62_0, stopped 273622737248)>
Warning -- Dangling thread: <_MainThread(MainThread, started 273774698528)>
Re-running test.test_concurrent_futures.test_interpreter_pool in verbose mode

@StanFromIreland
StanFromIreland merged commit 8ca85b5 into python:main Jul 17, 2026
60 checks passed
@StanFromIreland
StanFromIreland deleted the inter-shutdown branch July 17, 2026 15:19
@StanFromIreland StanFromIreland added awaiting merge needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 17, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @StanFromIreland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @StanFromIreland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @StanFromIreland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @StanFromIreland, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 8ca85b5bc5a888b8329915aff0ceb34de9373546 3.13

@bedevere-app

bedevere-app Bot commented Jul 17, 2026

Copy link
Copy Markdown

GH-153847 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 17, 2026
@bedevere-app

bedevere-app Bot commented Jul 17, 2026

Copy link
Copy Markdown

GH-153848 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 17, 2026
@StanFromIreland StanFromIreland removed the needs backport to 3.13 bugs and security fixes label Jul 17, 2026
StanFromIreland added a commit that referenced this pull request Jul 17, 2026
…) (#153848)

(cherry picked from commit 8ca85b5)

Co-authored-by: Stan Ulbrych <stan@python.org>
StanFromIreland added a commit that referenced this pull request Jul 17, 2026
…) (#153847)

(cherry picked from commit 8ca85b5)

Co-authored-by: Stan Ulbrych <stan@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants